"""web URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from . views import  viewsindex,viewsusers,viewscates,viewsgoods,viewsorders,authviews

urlpatterns = [
    # 后台首页
    url(r'^$', viewsindex.index,name='myadmin_index'),
    # 后台登录页面
    url(r'^login/$', authviews.myadminlogin,name='myadmin_login'),
    # 验证码
    url(r'^verifycode/$', viewsindex.verifycode,name='myadmin_verifycode'),
    # 退出登录
    url(r'^logout/$', authviews.myadminlogout,name='myadmin_logout'),

    # 后台权限管理
    # 后台用户添加
    url(r'^auth/user/add$',authviews.useradd,name='auth_user_add'),
    # 后台用户列表
    url(r'^auth/user/list$',authviews.userlist,name='auth_user_list'),
    # 删除
    url(r'^auth/user/del/(?P<uid>[0-9]+)$',authviews.userdel,name='auth_user_del'),


    # 后台组添加
    url(r'^auth/group/add$',authviews.groupadd,name='auth_group_add'),
    # 后台组列表
    url(r'^auth/group/list$',authviews.grouplist,name='auth_group_list'),
    url(r'^auth/group/edit/(?P<gid>[0-9]+)$',authviews.groupedit,name='auth_group_edit'),








    # 会员管理
    # 会员添加
    url(r'^user/add/$', viewsusers.useradd,name='myadmin_useradd'),
    # 会员列表
    url(r'^user/index/$', viewsusers.userindex,name='myadmin_userindex'),
    # 会员修改
    url(r'^user/edit/(?P<uid>[0-9]+)/$', viewsusers.useredit,name='myadmin_useredit'),
    # 会员删除
    url(r'^user/del/(?P<uid>[0-9]+)/$', viewsusers.userdel,name='myadmin_userdel'),



    # 商品分类管理
    # 商品添加
    url(r'^cates/add/$',viewscates.catesadd,name='myadmin_catesadd'),
    # 商品列表
    url(r'^cates/index/$',viewscates.catesindex,name='myadmin_catesindex'),
    # 商品删除
    url(r'^cates/del/$',viewscates.catesdel,name='myadmin_catesdel'),
    # 商品修改
    url(r'^cates/edit/$',viewscates.catesedit,name='myadmin_catesedit'),


    # 商品管理
    # 商品添加
    url(r'^goods/add/$',viewsgoods.goodsadd,name='myadmin_goodsadd'),
    # 商品执行添加
    url(r'^goods/insert/$',viewsgoods.goodsinsert,name='myadmin_goodsinsert'),
    # 商品列表
    url(r'^goods/index/$',viewsgoods.goodsindex,name='myadmin_goodsindex'),
    # 商品删除
    url(r'^goods/del/(?P<uid>[0-9]+)/$',viewsgoods.goodsdel,name='myadmin_goodsdel'),
    # 商品修改
    url(r'^goods/edit/(?P<uid>[0-9]+)/$',viewsgoods.goodsedit,name='myadmin_goodsedit'),


    # 订单管理
    # 订单列表
    url(r'^orders/index/$',viewsorders.ordersindex,name='myadmin_ordersindex'),
    # 订单详情
    url(r'^orders/indexinfo/$',viewsorders.indexinfo,name='myadmin_indexinfo'),
    # 订单状态修改
    url(r'^orders/statusedit/$',viewsorders.statusedit,name='myadmin_statusedit'),










    
]
